<#macro htmlBigModal title="" id="modal" type="message" width="900px" backdrop="true" keyboard="true" buttons="">
    <@htmlModal title="${title}" id="${id}" type="${type}" width="${width}"
    backdrop="${backdrop}" keyboard="${keyboard}" buttons="${buttons}"/>
</#macro>
<#macro htmlModal title="" id="modal" type="message" width="570px"
dataDismiss="modal" backdrop="true" keyboard="true" buttons="">
<div class="modal" id="${id}" style="overflow:scroll" data-backdrop="${backdrop}" data-keyboard="${keyboard}">
    <div class="modal-dialog" style="width:${width};">
        <div class="modal-content modal-fusion">
            <div class="modal-header" id="${id}Header">
                <button type="button" class="close" data-dismiss="${dataDismiss}" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <#if (title == "")>
                    <h4 class="modal-title" id="${id}Title"><@s.message "modal.title"/></h4>
                <#else>
                    <h4 class="modal-title" id="${id}Title">${title}</h4>
                </#if>
            </div>
            <div class="modal-body" id="${id}Body">
                <#nested/>
            </div>
            <div class="modal-footer" id="${id}Footer">
            <#--<button type="button" class="btn btn-default pull-left btn-close"-->
            <#--data-dismiss="${dataDismiss}" id="${id}Close"><@s.message "modal.close"/></button>-->
            ${buttons}
                <#if (type == "save")>
                    <button type="button" class="btn btn-success edit-action btn-save"
                            id="${id}Save"><@s.message "modal.save"/></button>
                </#if>
                <#if (type == "consumer-apply")>
                    <button type="button" class="btn btn-success edit-action btn-save"
                            id="${id}Save"><@s.message "modal.apply"/></button>
                </#if>
                <#if (type == "apply")>
                    <button type="button" class="btn btn-success edit-action btn-allow"
                            id="${id}Allow"><@s.message "modal.apply.allow"/></button>
                    <button type="button" class="btn btn-success edit-action btn-reject"
                            style="background-color: #3e4659;"
                            id="${id}Reject"><@s.message "modal.apply.reject"/></button>
                </#if>
                <#if (type == "revocation")>
                    <button type="button" class="btn btn-success edit-action btn-revocation"
                            style="background-color: #3e4659;"
                            id="${id}Reject"><@s.message "modal.apply.revocation"/></button>
                </#if>
                <button type="button" class="btn btn-default pull-right btn-close"
                        data-dismiss="${dataDismiss}" id="${id}Close"><@s.message "modal.close"/></button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
</#macro>

<#macro htmlFuzzySearchListForm insert="true" export="false">
<form class="hide" id="fuzzySearchListForm" method="post">
    <input id="fuzzyField" name="fuzzyField" value="${fuzzyField!''}">
    <input id="pageIndex" name="pageIndex" value="${page.pageIndex!''}">
    <input id="pageSize" name="pageSize" value="${page.pageSize!''}">
    <input id="pagesNum" name="pagesNum" value="${page.pagesNum!''}">
    <#nested/>
</form>
<div class="input-group input-group-fusion pull-right">
    <input type="text" class="form-control input-sm pull-right search-input"
           id="fuzzyFieldStr" name="fuzzyFieldStr" placeholder="<@s.message "page.search"/>"
           value="${fuzzyField!''}">
    <div class="input-group-btn">
        <button class="btn btn-sm btn-default search-button"><i class="fa fa-search"></i></button>
    </div>
    <#if insert == 'true'>
        <div class="input-group-btn">
            <button class="btn btn-default btn-sm action-insert">
                <i class="fa fa-plus"> <@s.message "page.insert"/></i>
            </button>
        </div>
    </#if>
    <#if export == 'true'>
        <div class="input-group-btn">
            <button class="btn btn-default btn-sm action-export">
                <i class="fa fa-download"> <@s.message "page.export"/></i>
            </button>
        </div>
    </#if>
</div>
</#macro>
<#macro htmlSearchListForm>
<form class="form-horizontal form-search" id="searchListForm" method="post">
    <div class="hide">
        <input id="fuzzyField" name="fuzzyField" value="${fuzzyField!''}">
        <input id="pageIndex" name="pageIndex" value="${(page.pageIndex)!''}">
        <input id="pageSize" name="pageSize" value="${page.pageSize!''}">
        <input id="pagesNum" name="pagesNum" value="${page.pagesNum!''}">
    </div>
    <div class="row">
        <#nested/>
    </div>
</form>
</#macro>

<#macro htmlPaginationOverview>
<div class="col-sm-5 pagination-overview"
     data-start-row="${(page.startRow)!'0'}"
     data-end-row="${(page.endRow)!'1'}"
     data-total-num="${(page.totalNum)!'0'}"
>
</div>
<div class="col-sm-7 pagination-list"></div>
</#macro>

<#macro htmlStateSpan state>
    <#if (state)! == "ACTIVE">
    <span class="label label-success"><@s.message "enum.state.active"/></span>
    <#else>
    <span class='label label-warning'><@s.message "enum.state.disabled"/></span>
    </#if>
</#macro>

<#macro htmlapplyStateSpan state>
    <#if (state)! == "WAITING">
    <span class="label label-success"><@s.message "apply.state.waiting"/></span>
    <#elseif (state)! == "ALLOW"||(state)! == "ALLOW_HIS">
    <span class="label label-info"><@s.message "apply.state.allow"/></span>
    <#elseif (state)! == "REVOCATION">
    <span class="label label-warning"><@s.message "apply.state.revocation"/></span>
    <#elseif !state?? ||(state)! == "NOTAPPLY">
    <span class='label label-warning' style="background-color: greenyellow"><@s.message "apply.state.no"/></span>
    <#else>
    <span class='label label-warning'><@s.message "apply.state.reject"/></span>
    </#if>
</#macro>

<#macro htmlBooleanSpan value=false yes="enum.boolean.true" no="enum.boolean.false">
    <#if value == true >
    <span class="label label-success"><@s.messageText yes yes /></span>
    <#else>
    <span class='label label-warning'><@s.messageText no no /></span>
    </#if>
</#macro>

<#macro htmlPageBtnInsert actionType="action-insert">
<button class="btn btn-default btn-sm ${actionType}">
    <i class="fa fa-plus"> <@s.message "page.insert"/></i>
</button>
</#macro>

<#macro htmlPageBtnGroupEditDelete insertBefore=false>
<div class="btn-group no-padding">
    <#if insertBefore == true>
        <#nested />
    </#if>
    <button class="btn btn-default btn-sm action-edit">
        <i class="fa fa-edit"> <@s.message "page.edit"/></i>
    </button>
    <button class="btn btn-default btn-sm action-delete">
        <i class="fa fa-trash-o"> <@s.message "page.delete"/></i>
    </button>
    <#if insertBefore == false>
        <#nested />
    </#if>
</div>
</#macro>

<#macro erModel initBodyContent="Loading">
<div class="modal" id="erModal" draggable="false">
    <div class="modal-erMap">
        <div class="modal-content">
            <div class="modal-erMap-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <h4 class="modal-title"><@s.message "datanode.modal.title"/></h4>
            </div>
            <div class="modal-body" id="erModalBody">
            ${initBodyContent}
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>
</#macro>
